<template>
	<text class="system-msg">{{friendlyTime}} {{content}}</text>
</template>

<script>
import toFriendlyTime from '@/lib/toFriendlyTime.js';
	export default {
		props: {
			msg: {
				type: Object,
				default(){
					return {
						userList:[]
					}
				}
			},
		},
		computed: {
			friendlyTime(){
				return toFriendlyTime(this.msg.serviceCreateTime || this.msg.client_serviceCreateTime)
			},
			content() {
				// console.error(1212,this.msg)
        // switch (this.msg.action){
        //   case "join-group-notice":
        //     return ''+ this.msg.body.user_list.map(item=>item.nickname).join(' , ') + ' 加入群聊'
        //     break;
        //   default:
        //     return this.msg.body
        //     break;
        // }
				switch (this.msg.msgType){
					default:
						return this.msg.content
				}
			}
		},
		data() {
			return {

			};
		}
	}
</script>

<style lang="scss">
	.system-msg {
		background-color: #f2f2f2;
		color: #9d9e9d;
		font-size: 14px;
		height: 30px;
		line-height: 30px;
		padding: 0 15rpx;
		border-radius: 8px;
	}
</style>